/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.View;

import java.awt.Color;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.geom.RoundRectangle2D;
import javax.swing.JPanel;

/**
 *
 * @author admin
 */
public class Menggambar extends JPanel{
    public Menggambar() {
        setBackground(Color.white);
    }

    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(Color.GREEN);
        g.drawLine(10,50, 50, 10);
        g.drawLine(50, 10, 300, 10);
        g.drawLine(300, 10, 340, 50);
        g.drawLine(10, 50, 340, 50);
        g.drawLine(50, 50, 50, 150);
        g.drawLine(300, 150, 300, 50);
        g.drawLine(300, 150, 50, 150);
        g.drawLine(150, 150, 150, 70);
        g.drawLine(150, 70, 200, 70);
        g.drawLine(200, 70, 200, 150);
        
//        g.setColor(Color.red);
//        g.drawRect(50, 10, 50, 50);
//        g.setColor(new Color(255, 0, 0));
//        g.fillOval(100, 10, 50, 50);
//        g.setColor(new Color(0, 255, 0));
//        g.fillArc(150, 10, 50, 50, 0, 180);
//        Graphics2D g2 = (Graphics2D) g;
// fill RoundRectangle2D.Double
//        GradientPaint redtowhite = new GradientPaint(200, 10, Color.red, 250, 10, Color.black);
//        g2.setPaint(redtowhite);
//        g2.fill(new RoundRectangle2D.Double(200, 10, 50, 50, 10, 10));
////g2.setPaint();
//        g2.drawString("Filled RoundRectangle2D", 200, 80);
    }
    
}
